package com.stylefeng.guns.modular.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 企业客户
 * </p>
 *
 * @author yinjc123
 * @since 2018-04-02
 */
@TableName("crm_customer_company")
@Data
public class CustomerCompany extends Model<CustomerCompany> {

    private static final long serialVersionUID = 1L;

    /**
     * 企业编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 企业名称
     */
    @NotBlank(message = "企业名称不能为空")
    private String name;
    /**
     * 统一社会信用代码
     */
    @TableField("unified_social_credit_code")
    @NotBlank(message = "统一社会信用代码不能为空")
    @Length(min = 18, max = 18)
    private String unifiedSocialCreditCode;
    /**
     * 企业简称
     */
    @TableField("short_name")
    @NotBlank(message = "企业简称不能为空")
    private String shortName;
    /**
     * 法定代表人
     */
    @TableField("legal_person")
    @NotBlank(message = "法定代表人不能为空")
    private String legalPerson;
    /**
     * 所属集团
     */
    @NotBlank(message = "所属集团不能为空")
    private String corporation;
    /**
     * 所属板块
     */
    private String section;
    /**
     * 军工代码
     */
    @TableField("military_code")
    private String militaryCode;
    /**
     * 所属区域
     */
    @TableField("area_id")
    @NotNull(message = "所属区域不能为空")
    private Integer areaId;
    /**
     * 主营业务或产品
     */
    @TableField("main_business")
    private String mainBusiness;
    /**
     * 逻辑删除
     */
    @TableField(value = "delete_flag")
    @TableLogic
    private Integer deleteFlag;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
